<?php
/**
 * Template for filter items block
 *
 * @see Mage_Catalog_Block_Layer_Filter
 */
?>
<?php if ($removeUrl = Mage::helper('layerednavigation')->getRemoveUrl($this->_filter)): ?>
<div class="filter-act">
	<a class="btn-remove" href="<?php echo $removeUrl ?>" title="<?php echo $this->__('Clear All') ?>"><?php echo $this->__('Clear All') ?></a>
</div>
<?php endif ?>

<?php $helper = Mage::helper('layerednavigation'); ?>
<ol class="filter img-filter">
<?php foreach ($this->getItems() as $_item): ?>
	<?php $imgUrl = $helper->getOptionImage($_item->getValue()); ?>
    <li <?php if($_item->isSelected()): ?>class="selected"<?php endif ?>
		<?php if(!$imgUrl): ?>style="display: none;"<?php endif ?>
	>
		
        <?php if (!$_item->isSelected()): ?>
        <a href="<?php echo $this->urlEscape($_item->getUrl()) ?>" title="<?php echo $_item->getLabel()?> <?php if ($this->shouldDisplayProductCount()): ?>(<?php echo $_item->getCount()?>)<?php endif ?>">
			<?php if($imgUrl): ?>
			<img src="<?php echo $imgUrl ?>" alt="<?php echo $_item->getLabel() ?>" />
			<?php //else: echo $_item->getLabel(); ?>
			<?php endif; ?>
		</a>
        <?php else: ?>
			<?php if($imgUrl): ?>
			<img src="<?php echo $imgUrl ?>" alt="<?php echo $_item->getLabel() ?>" title="<?php echo $_item->getLabel()?> <?php if ($this->shouldDisplayProductCount()): ?>(<?php echo $_item->getCount()?>)<?php endif ?>" />
			<?php //else: echo $_item->getLabel(); ?>
			<?php endif; ?>
        <?php endif; ?>
    </li>
<?php endforeach ?>
</ol>